package LawsonTransformJava.dao;
public class DAOFactoryDB {
	protected static DAODB me = null;

	public DAOFactoryDB() {
		if(DAObject.DAODBTYPE.equalsIgnoreCase("MSA"))
			me=new DAOAccessDB();
		else
			me = new DAOOracleDB();
	}
	
	public static DAODB getDAODB() {
		if (me==null) {
			if(DAObject.DAODBTYPE.equalsIgnoreCase("MSA"))
				me=new DAOAccessDB();
			else
				me = new DAOOracleDB();
		}
		return me;
	}
	
	public static DAODB getDAODB(boolean returnNew) {
		if (DAObject.DAODBTYPE.equalsIgnoreCase("MSA"))
			return (returnNew==true?new DAOAccessDB():getDAODB());
		return (returnNew==true?new DAOOracleDB():getDAODB());		
	}
}
